# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pyee
pkgname=('python2-pyee' 'python-pyee')
_pkgname=pyee
pkgver=13.0.0
pkgrel=1
pkgdesc='A port of node.js EventEmitter to python.'
arch=('any')
url='https://pypi.org/project/pyee/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python2-pytest-runner' 'python-setuptools'
			 'python-pytest-runner' 'python-pytest-asyncio'
             'python-vcversioner')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d4e10fca309d770ed46fdbda4c33ca1c49f089b1e9914a761ea18aff7b818e28e8a5212980ae1a7853c98ecaa5e5d3bfef4db8bc7afd5f8699d2a798a7647513')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pyee() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-pyee() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

